<?php

namespace front\modules\app\controllers;


use backfeed\services\SuggestionService;
use front\controllers\WebBaseController;
use Yii;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * SuggestionController implements the CRUD actions for Suggestion model.
 */
class SuggestionController extends WebBaseController
{
    /**
     * Creates a new Suggestion model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * post [
     *  'user_id',
     *  'content',
     * ]
     * @return mixed
     */
    public function actionCreate()
    {
        $data = Yii::$app->request->post();
        $result = SuggestionService::add($data);
        return json_encode($result);
    }
}
